package base;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 返回结果对象
 *
 * @author liujia
 */
@ToString
public class BaseReturn implements Serializable {
    public static final String SUCCESS = "000000";
    public static final String SUCCESS_STR = "执行成功";
    public static final String ERROR = "999999";
    public static final String ERROR_STR = "系统异常";

    @Getter @Setter
    private String code;
    @Getter @Setter
    private String message;
    @Getter @Setter
    private Serializable result;

    public BaseReturn(String code, String message, Serializable result) {
        this.code = code;
        this.message = message;
        this.result = result;
    }

    public BaseReturn(String code, String message) {
        this(code, message, null);
    }

    public BaseReturn(Serializable result) {
        this(SUCCESS, SUCCESS_STR, result);
    }
}
